<template>
  <div class="articleItem">
    <van-cell @click="$router.push('/article/' + article.art_id)">
      <div slot="title" class="title van-multi-ellipsis--l2">
        {{ article.title }}
      </div>
      <div class="auth" slot="label">
        <div v-if="article.cover.type === 3" class="cover-wrap">
          <div
            class="cover-imgs"
            v-for="(img, ind) in article.cover.images"
            :key="ind"
          >
            <van-image fit="cover" class="cover-img" :src="img" />
          </div>
        </div>

        <div class="label-info">
          <span>{{ article.aut_name }}</span>
          <span>{{ article.comm_count }}评论</span>
          <span>{{ article.pubdate }}</span>
        </div>
      </div>
      <van-image
        slot="default"
        v-if="article.cover.type === 1"
        fit="cover"
        class="cover-right"
        :src="article.cover.images[0]"
      />
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'ArticleItemIndex',
  props: {
    article: {
      type: Object,
      required: true
    }
  },
  components: {},
  computed: {},
  created () {},
  mounted () {},
  watch: {},
  data () {
    return {}
  },
  methods: {}
}
</script>

<style lang="less" scoped>
.title {
  font-size: 32px;
  color: #3a3a3a;
}

.van-cell__value {
  flex: unset;
  width: 232px;
  height: 146px;
  padding-left: 25px;
}
.cover-right {
  width: 232px;
  height: 146px;
}

.label-info span {
  font-size: 22px;
  color: #b4b4b4;
  margin-right: 25px;
}
.cover-wrap {
  display: flex;
  padding: 30px 0;
  .cover-imgs {
    flex: 1;
    height: 146px;
    // & 表示自身
    &:not(:last-child) {
      padding-right: 4px;
    }
    .cover-img {
      width: 100%;
      height: 146px;
    }
  }
}
</style>
